package com.demo.svc;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

@Service("rsadecrypt")
public class RsaDecrypt {
	
	@Resource(name="encrytFunc")
	private Encryption crypt;
	
	@SuppressWarnings("deprecation")
	public Map<String,String> doRun(String content) throws Exception{
		
		
		Map<String,String>  response = new HashMap<String, String>();
		
		//一下段落为对hex16进制string解析成byte
		content = content.toUpperCase();  
	    int length = content.length() / 2;  
	    char[] hexChars = content.toCharArray();  
	    byte[] d = new byte[length];  
	    for (int i = 0; i < length; i++) {  
	        int pos = i * 2;  
	        d[i] = (byte) ( "0123456789ABCDEF".indexOf(hexChars[pos]) << 4 |  "0123456789ABCDEF".indexOf(hexChars[pos + 1]));  
	    }  
		
		
		
		
		
        crypt.decryptionByte(d);
		
		
		return response;
	}

}
